package chouxian;

public class Test {
    public static void main(String[] args) {
        mao mao = new mao();
        mao.eat();
        mao.he();
        gou gou = new gou();
        gou.eat();
        gou.he();
    }
}

abstract class  Dongwu {
    public  abstract void eat() ;

    public void he() {
        System.out.println("喝水");
    }
}

class mao extends Dongwu {
    @Override
    public void eat() {
        System.out.println("吃鱼");
    }
}

class gou extends Dongwu {
    @Override
    public void eat() {
        System.out.println("吃狗粮");
    }
}
class Zhu extends Dongwu{
    @Override//检验是否方法重写
    public void eat(){
        System.out.println("吃猪粮");
    }
}

